Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci : Add github action workflow for okd 4.14.0 cluster with crc #6389

Merged
merged 4 commits into from
Oct 24, 2024

Conversation

rohanKanojia
Copy link
Member

@rohanKanojia rohanKanojia commented Sep 30, 2024

Description

Add workflow for OKD 4.14.0 for running Fabric8 Kubernetes Client E2E tests.

  • We create crc cluster with a custom okd preset, that creates a cluster based on OpenShift Kubernetes Distribution
  • CRC version is bound to OKD, for future upgrades we would need to bump CRC version.
  • I managed to get it working with CRC 2.32.0, I couldn't get it working with latest version of CRC, I've created [BUG] Unable to build application on a Crc configured cluster with okd preset  crc-org/crc#4382 on crc repository
  • Update existing tests for running on OpenShift Kubernetes Distribution 4.x:
    • add support for handing networking.k8s.io/v1 Ingress in ServiceToURLIT, replace deprecated methods
    • Add an exception to PluralizeIT for ResourceAccessReview resource, OpenShift Aggregated Discovery API is returning singularName for this resource as localresourceaccessreview, that does not match test expectations
    • Relax assertion check in ApiVersionsIT to not match exact hostname for server address

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • Feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change
  • Chore (non-breaking change which doesn't affect codebase;
    test, version modification, documentation, etc.)

Checklist

  • Code contributed by me aligns with current project license: Apache 2.0
  • I Added CHANGELOG entry regarding this change
  • I have implemented unit tests to cover my changes
  • I have added/updated the javadocs and other documentation accordingly
  • No new bugs, code smells, etc. in SonarCloud report
  • I tested my code in Kubernetes
  • I tested my code in OpenShift

Signed-off-by: Rohan Kumar [email protected]

@rohanKanojia rohanKanojia changed the title test : ServiceToUrlIT adjusted to run on OpenShift 4.x ci : Add github action workflow for okd 4.14.0 cluster with crc Sep 30, 2024
@rohanKanojia rohanKanojia force-pushed the pr/okd-crc-ci-pipeline branch 12 times, most recently from 66ec8ca to 6679f6a Compare October 1, 2024 12:59
@rohanKanojia rohanKanojia marked this pull request as ready for review October 1, 2024 18:13
Comment on lines 168 to 169
okd: [v4.14.0]
crc: [2.32.0]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a comment as to why these versions aren't the latest.
Also create an issue for further investigation and future updates and put the link in the comment.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have created this issue #6415. It's also referenced in TODO comment.

Comment on lines 188 to 202
- name: Remove unwanted stuff to free up disk image
run: |
sudo rm -rf /usr/share/dotnet
sudo rm -rf /usr/local/lib/android
sudo rm -rf /opt/ghc
sudo rm -rf "/usr/local/share/boost"
sudo rm -rf /opt/hostedtoolcache/CodeQL

sudo docker image prune --all --force

sudo swapoff -a
sudo rm -f /mnt/swapfile
sudo adduser $USER libvirt
sudo adduser $USER kvm
sudo usermod -a -G libvirt $USER
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have you tried not to include this extra-step?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When I try to remove this step in my test repository github action, I see this error:

write /home/runner/.crc/cache/tmp-extract/crc_okd_libvirt_4.14.0-0.okd-scos-2024-01-10-151818_amd64/crc.qcow2: no space left on device
Error: Process completed with exit code 1.

@manusa
Copy link
Member

manusa commented Oct 4, 2024

Since this takes ~30 minutes to run, it might be better to set it in a different workflow file and probably run only nightly.
We can consider making this per-pullrequest triggered once it gets quicker or it becomes more critical.

@rohanKanojia rohanKanojia force-pushed the pr/okd-crc-ci-pipeline branch 2 times, most recently from 20b76b0 to 26900b1 Compare October 4, 2024 10:22
@rohanKanojia rohanKanojia force-pushed the pr/okd-crc-ci-pipeline branch 5 times, most recently from 403c44e to bd75f23 Compare October 22, 2024 05:44
- name: Start the crc
run: sudo -su $USER crc start
- name: Install Kubernetes Client
run: ./mvnw ${MAVEN_ARGS} clean install -DskipTests -Djacoco.skip=true
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Imake quickly should be used here instead.

Especially if we intend to run this for each PR

jobs:
openshift-kubernetes-distribution:
name: CRC ${{ matrix.crc }} / OKD ${{ matrix.okd }}
runs-on: ubuntu-24.04
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Won't this run faster in macos?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I checked with crc team about this. They had tried it in past but it didn't work due to limited resources available on macOS runner. I'll check it again and see if it's possible.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried setting up CRC on MacOS runner but wasn't successful in doing it. For some reason workflow gets cancelled automatically during crc start (see action logs)

Screenshot_20241022_225243

@rohanKanojia rohanKanojia force-pushed the pr/okd-crc-ci-pipeline branch 2 times, most recently from af18f08 to d1d67ed Compare October 22, 2024 14:59
@manusa
Copy link
Member

manusa commented Oct 23, 2024

It is still failing though

+ Relax assertion check in ApiVersionsIT to not match exact hostname for
  server address
+ Add an exception in PluralizeIT for type ResourceAccessReview, it's
  singular name is coming as localresourceaccessreview from OpenShift
  Aggregated Discovery API

Signed-off-by: Rohan Kumar <[email protected]>
@rohanKanojia rohanKanojia force-pushed the pr/okd-crc-ci-pipeline branch from d1d67ed to 5e6bc0d Compare October 23, 2024 08:35
Copy link

@manusa manusa added this to the 7.0.0 milestone Oct 24, 2024 — with automated-tasks
Copy link
Member

@manusa manusa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thx!

@manusa manusa merged commit 9b3fd52 into fabric8io:main Oct 24, 2024
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants